package polymorphicTask.eat;

public abstract class Pet {
    //使用多态模拟猫和狗的吃食的不同行为
    public abstract void eat();
}
class Dog extends Pet{
    public void eat(){
        System.out.println("小狗吃东西");
    }
    }
class Cat extends Pet{
    public void eat(){
        System.out.println("小猫吃东西");
    }
}
